﻿Option Strict On
Option Explicit On
Option Infer On

Imports System
Imports System.Linq
Imports System.Collections.Generic
Imports GenDotNet.Task.Common
Imports GenDotNet.TemplateSupport.VB
Imports GenDotNet.TemplateData
Imports GenDotNet.TemplateData.VB
'Imports <xmlns="http://kadgen.com/tempCode">

Public MustInherit Class VbBase
   Inherits DotNetBase

   Protected Sub New()
      MyBase.New()
      Me.wrapString = " _" & crlf
   End Sub

   '   Protected Overrides Function OutputOpening() As String
   '      Dim code = _
   '<code>
   'Option Strict On
   'Option Explicit On
   'Option Infer On

   '<%= Me.FileImports.Output %>
   '   <%= crlf %>
   '   <%= If(String.IsNullOrEmpty(Me.ClassNamespace), String.Empty, "Namespace " & Me.ClassNamespace & crlf & tab) %>
   '   <%= Me.ClassInfo.OutputOpen() %>
   '</code>
   '      Return code.Value
   '   End Function

   '   Protected Overrides Function OutputClose() As String
   '      Dim code = _
   '<code>
   '   <%= crlf %>
   '   <%= Me.ClassInfo.OutputClose %>
   '   <%= If(String.IsNullOrEmpty(Me.ClassNamespace), String.Empty, crlf & "End Namespace") %>
   '</code>
   '      Return code.Value
   '   End Function

   'Protected Overrides Function SetUp() As Boolean
   '   MyBase.SetUp()
   'End Function

   '#Region "OutputFields"
   ' Field outputting needs some work. Not currently generalized (not avialble for C#)

   'Protected Function OutputFieldDeclaration( _
   '         ByVal name As String, _
   '         ByVal type As StandardNetType, _
   '         ByVal setNew As Boolean) _
   '         As String
   '   ' Assume private for feilds
   '   Return OutputFieldDeclaration(name, type.Output, setNew)
   'End Function

   'Protected Function OutputFieldDeclaration( _
   '         ByVal name As String, _
   '         ByVal type As String, _
   '         ByVal setNew As Boolean) _
   '         As String
   '   ' Assume private for feilds
   '   Return OutputFieldDeclaration(name, type, type & OutputNew() & type & "()")
   'End Function

   'Protected Function OutputFieldDeclaration(ByVal name As String, ByVal type As StandardNetType) As String
   '   Return OutputFieldDeclaration(name, type.Output)
   'End Function

   'Protected Function OutputFieldDeclaration(ByVal name As String, ByVal type As String) As String
   '   ' Assume private for feilds
   '   Return OutputFieldDeclaration(name, type, CStr(Nothing))
   'End Function

   'Protected Function OutputFieldDeclaration( _
   '         ByVal name As String, _
   '         ByVal type As StandardNetType, _
   '         ByVal defaultValue As String) _
   '         As String
   '   ' Assume private for feilds
   '   Return OutputFieldDeclaration(name, type.Output, defaultValue)
   'End Function

   'Protected Function OutputFieldDeclaration( _
   '         ByVal name As String, _
   '         ByVal type As String, _
   '         ByVal defaultValue As String) _
   '         As String
   '   ' Assume private for feilds
   '   Return "   Private " & name & " As " & type & _
   '            If(String.IsNullOrEmpty(defaultValue), String.Empty, " = " & defaultValue) & crlf
   'End Function

   '#End Region

   'Protected Overrides Function OutputConstructor(ByVal del As MethodDelegate) As String
   '   Return OutputConstructor(Nothing, del)
   'End Function

   '   Protected Overrides Function OutputConstructor(ByVal params As ParameterInfoCollection, ByVal del As MethodDelegate) As String
   '      Return <code>
   '   Protected Sub New(<%= params.Output %>)
   '   <%= del.Invoke() %>
   '   End Function
   '</code>.Value
   '   End Function

   '   Protected Overrides Function OutputSub( _
   '            ByVal name As String, _
   '            ByVal params As ParameterInfoCollection, _
   '            ByVal del As MethodDelegate) _
   '            As String
   '      Return <code>
   '   Protected Sub <%= name %>(<%= params.Output %>)
   '   <%= del.Invoke %>
   '   End Function
   '</code>.Value
   '   End Function

   '   Protected Overrides Function OutputFunction( _
   '            ByVal name As String, _
   '            ByVal returnType As NetTypeInfo, _
   '            ByVal params As ParameterInfoCollection, _
   '            ByVal del As MethodDelegate) _
   '            As String
   '      Return <code>
   '   Protected Function <%= name %>(<%= params.Output %>) As <%= returnType.Output %><%= crlf %>
   '                <%= Spaces(9) %><%= del.Invoke() %>
   '   End Function
   '</code>.Value
   '   End Function

   'Protected Overrides Function OutputReturn() As String
   '   Return "Return"
   'End Function

   'Protected Overrides Function OutputNew() As String
   '   Return "New"
   'End Function

   'Protected Overrides Function OutputNew(ByVal className As String) As String
   '   Return "New " & className & "()"
   'End Function

   'Protected Overrides Function OutputMe() As String
   '   Return "Me"
   'End Function

   'Protected Overrides Function OutputAndAlso() As String
   '   Return "AndAlso"
   'End Function

   'Protected Overrides Function OutputOrElse() As String
   '   Return "OrElse"
   'End Function

End Class
